Repository navigation
docs: fix misleading internal import path in Getting Started guide - #4
Open
ElizioMartins wants to merge 1 commit into
Open
ElizioMartins wants to merge 1 commit into
ElizioMartins wants to merge 1 commit into
Conversation
The "Initializing ObjectBox" section used the internal example package path as an import in the code snippet: "github.com/objectbox/objectbox-go/examples/tasks/internal/model" Go enforces that internal packages can only be imported by code within the same module, so copying this snippet causes an immediate compile error: "use of internal package ... not allowed". Replace it with a generic placeholder that clearly shows users they must substitute their own module name, and add a hint block to make that requirement explicit. Fixes objectbox/objectbox-go#28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Initializing ObjectBox" section of the Getting Started guide shows this import:
This is the import path of the internal example package inside the ObjectBox repository itself. In Go,
internalpackages can only be imported by code within the same module — so any user who copies this snippet verbatim will immediately get a compile error:This issue has been open since November 2020 (objectbox/objectbox-go#28) and has caused confusion for multiple users.
Fix
Replaced the internal import with a generic placeholder (
github.com/my-org/my-project/internal/model) and added a{% hint style="warning" %}block that makes it explicit users must substitute their own module name:This matches what the ObjectBox maintainer already explained in the issue thread — users should initialize their own Go module and use their own import paths.
Fixes objectbox/objectbox-go#28